package VUTHANHPHUC.OOP.HOMEWORK.EX01;

public class Controllers {
	// 1.datafiled
	private UserEntity m_objUser;
	private Models m_objModels;

	// 2.Ham khoi dung cho controllers
	public Controllers(UserEntity objUser) {
		m_objUser = objUser;
		// Khoi tao thong tin cho models
		m_objModels = new Models();
	}

	// 3.uy quyen thực thi nghiep vu thong qua Models
	public boolean CheckUser() {
		// Dieu huong thuc thi nghiep vu sau
		// 1.Kiem tra su ton tai cua tai khoan
		if (m_objModels.KiemTraSuTonTaiCuaTaiKhoan(m_objUser)) {
			if (m_objModels.KiemTraTTKichHoatTaiKhoan(m_objUser)) {
				if (m_objModels.KiemTraSoDuCuaTaiKhoan(m_objUser)) {
					if (m_objModels.KiemTraTTLockUnlockCuaTaiKhoan(m_objUser)) {
						return true;
					}
					return false;
				}
				return false;
			}
			return false;
		}
		return false;
	}
}
